package com.pa165.dao;

import com.pa165.entities.Employee;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;



@Stateless
public class EmployeeDAO implements EmployeeDAOLocal {

    @PersistenceContext
    private EntityManager em;

    @Override
    public void create(Employee employee) {
        em.persist(employee);
    }

    @Override
    public void update(Employee employee) {
        em.persist(em.merge(employee));
    }

    @Override
    public Employee find(Long id) {
       return em.find(Employee.class, id);
    }


 
    

}
